package com.xuexuehai.carrecommand.exception.enums;

import lombok.Data;

/**
 * @author xuexuehai
 * @mailBox xuehai.xue@QQ.com
 * @date 2021/8/19 11:22 下午
 */
public enum SysStatusEnums {

    //Success message
    /**
     * code: 20001<br/>msg: 用户登录成功
     */
    LOGIN_SUCCESS(20001,"用户登录成功"),
    /**
     * code: 20002<br/>msg: 查询所有车辆成功
     */
    CAR_SEARCH_SUCCESS(20002,"查询所有车辆成功"),
    /**
     * code: 20003<br/>msg: 用户注册成功
     */
    REGISTRY_SUCCESS(20003,"用户注册成功"),
    /**
     * code: 20004<br/>msg: 添加车型成功
     */
    CAR_ADD_SUCCESS(20004,"添加车型成功"),
    /**
     * code: 20005<br/>msg: 查询汽车车商有几种车型成功
     */
    CAR_FACTORY_NUMS_SUCCESS(20004,"查询汽车车商有几种车型成功"),


    //Exception message
    /**
     * code: 40001<br/>msg: 用户名或密码不能为空
     */
    ACCOUNT_NOT_NULL(40001,"用户名或密码不能为空"),
    /**
     * code: 40002<br/>msg: 用户名或密码错误
     */
    INVALID_USER(40002,"用户名或密码错误"),
    /**
     * code: 40003<br/>msg: 用户没有当前操作权限
     */
    INCORRECT_USER_PRIVS(40003,"用户没有当前操作权限"),
    /**
     * code: 40004<br/>msg: 未找到当前用户
     */
    USERNAME_NOT_FOUND(40004,"未找到当前用户"),
    /**
     * code: 40005<br/>msg: 当前用户未登录
     */
    NOT_LOGIN(40005,"当前用户未登录"),
    /**
     * code: 40006<br/>msg: 当前用户名已经被使用
     */
    USERNAME_USED(40006,"当前用户名已经被使用"),

    ;

    private int code;
    private String msg;

    public  int getCode(){
        return code;
    }
    public  String getMsg(){
        return msg;
    }

    private void setCode(int code){
        this.code = code;
    }
    private void setMsg(String msg){
        this.msg = msg;
    }

    SysStatusEnums(int code, String msg) {
        setCode(code);
        setMsg(msg);
    }
}
